From: Jasper St. Pierre Date: Mon, 4 Mar 2013 22:54:02 +0000 (-0500) Subject: overview: Don't use a captured-event handler to detect the control key X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4473 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b39e76200a772a68ec7a2293346958653d9f11eb;p=gnome-shell.git overview: Don't use a captured-event handler to detect the control key captured-event handlers are easily messed up by an earlier event handler capturing the event. Instead, use the current Clutter event and check for the state of that. https://bugzilla.gnome.org/show_bug.cgi?id=695161 https://bugzilla.gnome.org/show_bug.cgi?id=695801 --- diff --git a/js/ui/overview.js b/js/ui/overview.js index 7d00251d1..4fdcd02a2 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -95,9 +95,7 @@ const Overview = new Lang.Class({ _init: function() { this._overviewCreated = false; this._initCalled = false; - this._controlPressed = false; - global.stage.connect('captured-event', Lang.bind(this, this._capturedEvent)); Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated)); this._sessionUpdated(); }, @@ -241,20 +239,6 @@ const Overview = new Lang.Class({ } }, - _capturedEvent: function(actor, event) { - let type = event.type(); - if (type != Clutter.EventType.KEY_PRESS && - type != Clutter.EventType.KEY_RELEASE) - return false; - - let symbol = event.get_key_symbol(); - if (symbol == Clutter.KEY_Control_L || - symbol == Clutter.KEY_Control_R) - this._controlPressed = type == Clutter.EventType.KEY_PRESS; - - return false; - }, - _sessionUpdated: function() { this.isDummy = !Main.sessionMode.hasOverview; this._createOverview(); @@ -587,7 +571,8 @@ const Overview = new Lang.Class({ if (!this._shown) return; - if (this._controlPressed) + let event = Clutter.get_current_event(); + if (event && (event.get_state() & Clutter.ModifierType.CONTROL_MASK) != 0) return; this._animateNotVisible();